﻿using HZY.Framework.Repository.EntityFramework.Attributes;
using HZY.Framework.Repository.EntityFramework.Models.Standard;
using System.ComponentModel.DataAnnotations.Schema;
using MiniExcelLibs.Attributes;

namespace HZY.Framework.Repository.EntityFramework.Test.Models;

/// <summary>
/// 功能
/// </summary>
// [Table("sys_function")]
[TableName(NameRuleMode = NameRuleMode.TableName)]
public class SysFunction : DefaultEntity<Guid>
{
    /// <summary>
    /// 编号
    /// </summary>
    [ExcelColumn(Name = "编号", Width = 20)]
    [TableLogic(TableLogicType = TableLogicType.NullOr0NonDeleteValue)]
    // [Column("Number1111")]
    public int? Number { get; set; }

    /// <summary>
    /// 功能名称
    /// </summary>
    [ExcelColumn(Name = "功能名称", Width = 20), TableFieldEncrypt]
    public string? Name { get; set; }

    /// <summary>
    /// 功能标识
    /// </summary>
    [ExcelColumn(Name = "功能标识", Width = 20)]
    public string? ByName { get; set; }

    /// <summary>
    /// 备注
    /// </summary>
    [ExcelColumn(Name = "备注", Width = 20)]
    public string? Remark { get; set; }

    /// <summary>
    /// 
    /// </summary>
    [Dict("sys_user", "Id", "Name", ToField = nameof(CreatorUserId_Mapping))]
    [ExcelColumn(Name = "创建人", Width = 20)]
    public override Guid? CreatorUserId { get; set; }

    /// <summary>
    /// 
    /// </summary>
    [NotMapped]
    public string CreatorUserId_Mapping { get; set; }
}